const { tplReplace } = require('./tpl-utils')

module.exports = function (content) {
  content = content.replace(/\s+/g, '')
  const options = this.getOptions()
  const _log = options.log ? `console.log('path is ${this.resourcePath}')` : ''
  return `
    export default (options) => {
       ${tplReplace.toString()}
       ${_log}
       return tplReplace('${content}', options)
    }
  `
}
